/**
 * @author luoob
 * @description localStorage 模块
 * @date 2021-03-18
 */

// token 标识
const USER_TOKEN = 'token'

/**
 * 获取 token
 * @date 2021-07-14
 * @returns {any}
 */
const getToken = () => localStorage.getItem(USER_TOKEN)

/**
 * 存储 token
 * @date 2021-07-14
 * @param {any} token:string
 * @returns {any}
 */
const setToken = (token: string) => {
    localStorage.setItem(USER_TOKEN, String(token))
}

/**
 * 移除 token
 * @date 2021-07-14
 * @returns {any}
 */
const removeToken = () => {
    localStorage.removeItem(USER_TOKEN)
}

export default {
    getToken,
    setToken,
    removeToken
}


